$(function() {
    $('.search-form form').append("<input type=\"hidden\" id=\"etapa_form_search\" name=\"elemet\" value=\"validar\"/>");

    $("#Etapa_100").change(function() {
        if ($(this).is(':checked')) {
            $('#etapa_form_search').val('todos');

            $.fn.yiiGridView.update("Tareas-grid", {
                data: $('.search-form form').serialize()
            });
        } else {
            $('#etapa_form_search').val('validar');

            $.fn.yiiGridView.update("Tareas-grid", {
                data: $('.search-form form').serialize()
            });
        }
    });
});
function ExporCont(all) {
    if (all) {
        $('#formId').attr('action', baseUrl + "tareas/tarea/exportExcel");
        $('#id_tareas').val('todos');
        $('#formId').submit();
    }
    else {
        var selected = $("#Tareas-grid").selGridView("getAllSelection");
        if (selected != '') {
            $('#formId').attr('action', baseUrl + "tareas/tarea/exportExcel");
            $('#id_tareas').val(selected);
            $('#formId').submit();
        } else {
            bootbox.alert("Seleccione al menos un Contacto.");
        }
    }
}